package cn.liujianbo.example.pattern.decorator;

import java.math.BigDecimal;

/**
 * @author 刘建波
 * @date 2022-03-04 13:52
 */
public class EggDecorator extends GarnishDecorator {

    public EggDecorator(FastFood fastFood) {
        super(fastFood, "+鸡蛋", new BigDecimal(2));
    }

    @Override
    public BigDecimal cost() {
        return getPrice().add(getFastFood().cost());
    }
}
